package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Bvcxdkbr type
*/
@SuppressWarnings("ALL")
public class Bvcxdkbr {


        private static volatile Bvcxdkbr instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Bvcxdkbr getInstance() {
            if (instance == null) {
                synchronized (Bvcxdkbr.class) {
                    if (instance == null) {
                        instance = new Bvcxdkbr();
                    }
                }
            }
            return instance;
        }


        private Bvcxdkbr() {

        }



    public  Boolean judgeAdrsznzqoc(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeZtykhqzjcw(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeRjmfsbnfkb(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePzlosvzlzg(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeXzzvmpwdto(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOmscgaxlcf(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeFzvoixtaes(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeDggpqhhegj(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  adrsznzqoc;
    private String  ztykhqzjcw;
    private String  rjmfsbnfkb;
    private String  pzlosvzlzg;
    private String  xzzvmpwdto;
    private String  omscgaxlcf;
    private String  fzvoixtaes;
    private String  dggpqhhegj;


    public void setAdrsznzqoc(String adrsznzqoc){
    this.adrsznzqoc = adrsznzqoc;
    }

    public String getAdrsznzqoc(){
    return this.adrsznzqoc;
    }
    public void setZtykhqzjcw(String ztykhqzjcw){
    this.ztykhqzjcw = ztykhqzjcw;
    }

    public String getZtykhqzjcw(){
    return this.ztykhqzjcw;
    }
    public void setRjmfsbnfkb(String rjmfsbnfkb){
    this.rjmfsbnfkb = rjmfsbnfkb;
    }

    public String getRjmfsbnfkb(){
    return this.rjmfsbnfkb;
    }
    public void setPzlosvzlzg(String pzlosvzlzg){
    this.pzlosvzlzg = pzlosvzlzg;
    }

    public String getPzlosvzlzg(){
    return this.pzlosvzlzg;
    }
    public void setXzzvmpwdto(String xzzvmpwdto){
    this.xzzvmpwdto = xzzvmpwdto;
    }

    public String getXzzvmpwdto(){
    return this.xzzvmpwdto;
    }
    public void setOmscgaxlcf(String omscgaxlcf){
    this.omscgaxlcf = omscgaxlcf;
    }

    public String getOmscgaxlcf(){
    return this.omscgaxlcf;
    }
    public void setFzvoixtaes(String fzvoixtaes){
    this.fzvoixtaes = fzvoixtaes;
    }

    public String getFzvoixtaes(){
    return this.fzvoixtaes;
    }
    public void setDggpqhhegj(String dggpqhhegj){
    this.dggpqhhegj = dggpqhhegj;
    }

    public String getDggpqhhegj(){
    return this.dggpqhhegj;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}